import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()){
            int number = scanner.nextInt();
            System.out.println(main.isPrimeNumber(number));
        }
    }

    public Boolean isPrimeNumber(int number){
        if(number == 2){
            return true;
        }

        for (int i = 2; i < number; i++) {
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }
}
